import { createRouter, createWebHashHistory, createWebHistory } from "vue-router"

const routes = [
  {
    path: '/',
    name: 'index',
    component: () => import('@/components/Home.vue')
  },
  {
    path: '/navigation',
    name: 'navigation',
    component: () => import('@/pages/navigation/index.vue')
  },
  {
    path: '/study',
    name: 'study',
    children: [
      {
        path: 'list',
        name: 'courseList',
        component: () => import('@/pages/study/courseList/index.vue')

      }, {
        path: 'detail/:id',
        name: 'courseDetail',
        component: () => import('@/pages/study/courseDetail/index.vue')

      }
    ]
  },
  {
    path: '/home-work',
    name: 'homeWork',
    children: [
      {
        path: 'list',
        name: 'homeWorkList',
        component: () => import('@/pages/home-work/list/index.vue')
      }, {
        path: 'detail/:id',
        name: 'detail',
        component: () => import('@/pages/home-work/detail/index.vue')
      }
    ]
  },
  {
    path: '/media',
    name: 'home',
    children: [
      {
        path: 'welcome',
        name: 'welcome',
        component: () => import('@/pages/media/welcome.vue'),
      },
      {
        path: 'my-list',
        name: 'my-list',
        component: () => import('@/pages/media/my-list.vue'),
      }
    ]
  },
  {
    path: '/forum',
    name: 'forum',
    component: () => import('@/pages/forum/index.vue'),
    children: [
      {
        path: 'list',
        name: 'forumList',
        component: () => import('@/pages/forum/forumList/index.vue')
      },
      {
        path: 'detail/:id',
        name: 'forumDetail',
        component: () => import('@/pages/forum/forumDetail/index.vue')
      }
    ]
  }
]
export const router = createRouter({
  // history: createWebHashHistory(),
  history: createWebHistory(),
  routes: routes
})

export default router
